package com.huilian.iotbox.admin.wap.controller;

import com.huilian.iotbox.admin.wap.service.UserStoreService;
import com.huilian.iotbox.data.common.ServerResponse;
import com.huilian.iotbox.data.po.UserStore;
import com.huilian.iotbox.data.vo.UserInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * @author LinYinDong
 * @date 2024/11/7 上午10:24
 */
@RestController
@RequestMapping("/api/userStore")
public class UserStoreController extends UserInfoController {
    @Autowired
    private UserStoreService userStoreService;
    @GetMapping("/findAllocationStore")
    public ServerResponse findAllocationStore(HttpServletRequest request, UserStore userStore){
        UserInfo userInfo = super.getLoginUserInfo(request);
        userStore.setUserInfo(userInfo);
        return userStoreService.findAllocationStore(userStore);
    }
}